const { DataTypes } = require("sequelize");
const sequelize = require("./index");

const ProductLabel = sequelize.define("product_label", {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        allowNull: false,
        autoIncrement: true,
    },
    name: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    productId: {
        type: DataTypes.INTEGER,
        allowNull: false,
    }
},{
    timestamps: false
});

ProductLabel.associate = function ({
    Product
                           }) {
    ProductLabel.belongsTo(Product)
};

module.exports = ProductLabel;
